@extends('http.app')

@section('content')
    <div class="content">
        @include('http.partials.sitemap')

        <div class="clearfix lmbox">
            <div class="leftnr fl">
                <div class="lmtitle">
                    <h1>@isset($left_title){{$left_title}}@endisset</h1>
                </div>
                <div class="menunr" id="mm1">
                    <ul>
                        @isset($data['categories'])
                            @foreach($data['categories'] as $key=>$val)
                                <li @if($val['curr'])class="active"@endif>
                                    @if($val['url'])
                                        <a title='{{$val['title']}}' target="_blank" href='{{$val['url']}}'>{{$val['title']}}</a>
                                    @else
                                        <a title='{{$val['title']}}' href='/i/{{$val['id']}}'>{{$val['title']}}</a>
                                    @endif
                                </li>
                            @endforeach
                        @else
                            @foreach($data as $key=>$val)
                                <li>
                                @if($val['url'])
                                    <a title='{{$val['title']}}' target="_blank" href='{{$val['url']}}'>{{$val['title']}}</a>
                                @else
                                    <a title='{{$val['title']}}' href='/i/{{$val['id']}}'>{{$val['title']}}</a>
                                @endif
                                </li>
                            @endforeach
                        @endisset
                    </ul>
                </div>
            </div>
            <div class="rightnr">
                <div class="position"><span>@isset($right_title){{$right_title}}@endisset</span></div>
                <div class="listnews" id="mm2">
                    @isset($data['informations'])
                        <ul class="doc_list list-{{$val['id']}}">
                        @foreach($data['informations']['data'] as $key=>$val)
                            <li class="odd">
                                <a href="/d/{{$val['id']}}" target="_blank" title="{{$val['title']}}" class="left">
                                    <span class="sp sp_3">{{$val['title']}}</span>
                                </a>
                                <img src="/images/news.gif">
                                <span class="right date">{{date('Y-m-d', strtotime($val['created_at']))}}</span>
                            </li>
                        @endforeach
                        </ul>

                        <div id="page_16526206" class="pagination">分页</div>
                        <script>
                            Ls.pagination("#page_16526206", function(page) {
                                location.href = '/i/{{$id}}?page=' + page;
                            }, {
                                isTotal: true,
                                total: {{$data['informations']['total']}},
                                currPage: {{$data['informations']['current_page']}},
                                pageCount: {{$data['informations']['last_page']}},
                                param: "limit=18"
                            });
                        </script>
                    @else
                        @foreach($data as $key=>$val)
                            @isset($val['informations'])
                            <ul class="doc_list list-{{$val['id']}}">
                                <li class="columnName">
                                    <a class="left title" href="/i/{{$val['id']}}">{{$val['title']}}</a>
                                    <a class="right more" href="/i/{{$val['id']}}">更多>></a>
                                </li>

                                @foreach($val['informations'] as $k=>$v)
                                    <li class="odd">
                                        <a href="/d/{{$v['id']}}" target="_blank" title="{{$v['title']}}" class="left">
                                            <span class="sp sp_3">{{$v['title']}}</span>
                                        </a>
                                        <img src="/images/news.gif">
                                        <span class="right date">{{date('Y-m-d', strtotime($v['created_at']))}}</span>
                                    </li>
                                @endforeach

                            </ul>
                            @endisset
                        @endforeach
                    @endisset

                </div>
            </div>
        </div>
        <div class="clear20"></div>
    </div>
@endsection